import { defineConfig } from '@unocss/vite';
import transformerDirectives from '@unocss/transformer-directives';
import transformerVariantGroup from '@unocss/transformer-variant-group';
import presetUno from '@unocss/preset-uno';
import type { Theme } from '@unocss/preset-uno';
import { presetUnoCustom, rules } from '@sa/uno-config';
import { themeVars } from './src/theme/vars';

export default defineConfig<Theme>({
  content: {
    pipeline: {
      exclude: ['node_modules', 'dist']
    }
  },
  theme: {
    ...themeVars,
    fontSize: {
      'icon-xs': '0.875rem',
      'icon-small': '1rem',
      icon: '1.125rem',
      'icon-large': '1.5rem',
      'icon-xl': '2rem'
    },
    backgroundColor: {
      'background-deep': 'hsl(216 20.11% 95.47%)'
    },
    animation: {
      keyframes: {
        float:
          '{0% { transform: translateY(0); } 50% { transform: translateY(-20px); } 100% { transform: translateY(0); }}'
      },
      durations: {
        float: '5s'
      },
      timingFns: {
        float: 'linear'
      },
      properties: {
        float: {
          'animation-delay': '0ms'
        }
      },
      counts: {
        float: 'infinite'
      }
    }
  },
  shortcuts: {
    'card-wrapper': 'rd-8px shadow-sm'
  },
  transformers: [transformerDirectives(), transformerVariantGroup()],
  presets: [presetUno(), presetUnoCustom()],
  rules: [...rules]
});
